# -*- coding: UTF-8 -*-
__author__ = 'BK'
import os
'''
遍历邮件信息
给定目录，读出所有的邮件
返回邮件列表
'''
mailList=[]

def mails():

    path = os.getcwd()
    parent_path = os.path.dirname(path)
    pdatapath='E:\\gitproject\\mailHelper\\mailHelper\\mailHp\\algorithm\\data\\positive'
    ndatapath='E:\\gitproject\\mailHelper\\mailHelper\\mailHp\\algorithm\\data\\negative'

    mailList=[]
    if os.path.exists(pdatapath):
        files=os.listdir(pdatapath)
        for i in files:
            mailList.append(open(pdatapath+'\\'+i).read())

    if os.path.exists(ndatapath):
        files=os.listdir(ndatapath)
        for i in files:
            mailList.append(open(ndatapath+'\\'+i).read())

    return mailList
